<?php
require_once 'Database.php';
require_once 'SinhVien.php';
class SinhVienDAO{
	public static function findAll(){
		$db=Database::getInstance();
		$stmt=$db->prepare("SELECT*FROM sinhvien");
		$stmt->execute();
		$rows = $stmt->fetchAll();
		foreach($rows AS $row) {
			$sv = new SinhVien();
			$sv -> setID($row['id']);
			$sv -> setHoTen($row['hoten']);
			$sv -> setEmail($row['email']);
			$result[]=$sv;
			
		}
		return $result;
	}
}
?>